package com.everyday.practice.leetCode;

public class Title1 {
    public static void main(String[] args) {
        int[] arr=new int[5];
        arr[0]=-3;
        arr[1]=4;
        arr[2]=3;
        arr[3]=90;
//        arr[4]=90;
        int[] ints = toTarget(arr, 0);
        System.out.println(ints);
    }

    public static int[] toTarget(int[] nums, int target) {
        int[] rs=new int[2];
        for(int i=0;i<nums.length;i++){
            if(nums[i]<=target){
                for(int j=i+1;j<nums.length;j++){
                    if(nums[j]<=target){
                        if(nums[i]+nums[j]==target){
                            rs[0]=i;
                            rs[1]=j;
                            return rs;
                        }
                    }
                }
            }
        }
        return rs;
    }
}
